package com.study.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the goods database table.
 * 
 */
@Entity
@Table(name="goods")
@NamedQuery(name="Good.findAll", query="SELECT g FROM Good g")
public class Good implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="goo_id")
	private int gooId;


	@Column(name="goo_img")
	private String gooImg;

	@Column(name="goo_name")
	private String gooName;

	@Column(name="goo_price")
	private BigDecimal gooPrice;

	@Column(name="goo_spec")
	private int gooSpec;
	@Column(name="gdel")
	private int gdel;

	//bi-directional many-to-one association to Deliverdetail
	@OneToMany(mappedBy="good")
	private List<Deliverdetail> deliverdetails;

	//bi-directional many-to-one association to Category
	@ManyToOne
	@JoinColumn(name="cat_id")
	private Category category;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="goo_gunit")
	private Dictionary dictionary1;

	//bi-directional many-to-one association to Dictionary
	@ManyToOne
	@JoinColumn(name="goo_status")
	private Dictionary dictionary2;

	//bi-directional many-to-one association to Offersdetail
	@OneToMany(mappedBy="good")
	private List<Offersdetail> offersdetails;

	//bi-directional many-to-one association to Orderdetail
	@OneToMany(mappedBy="good")
	private List<Orderdetail> orderdetails;

	//bi-directional many-to-one association to Repairlist
	@OneToMany(mappedBy="good")
	private List<Repairlist> repairlists;

	//bi-directional many-to-one association to Returnmore
	@OneToMany(mappedBy="good")
	private List<Returnmore> returnmores;
	
	private Integer ddtime;
	public void setDdtime(Integer ddtime) {
		this.ddtime = ddtime;
	}
	public Integer getDdtime() {
		return ddtime;
	}
	
	public Good() {
	}

	public int getGooId() {
		return this.gooId;
	}

	public void setGooId(int gooId) {
		this.gooId = gooId;
	}

	public int getGdel() {
		return this.gdel;
	}

	public void setGdel(int gdel) {
		this.gdel = gdel;
	}

	public String getGooImg() {
		return this.gooImg;
	}

	public void setGooImg(String gooImg) {
		this.gooImg = gooImg;
	}

	public String getGooName() {
		return this.gooName;
	}

	public void setGooName(String gooName) {
		this.gooName = gooName;
	}

	public BigDecimal getGooPrice() {
		return this.gooPrice;
	}

	public void setGooPrice(BigDecimal gooPrice) {
		this.gooPrice = gooPrice;
	}

	public int getGooSpec() {
		return this.gooSpec;
	}

	public void setGooSpec(int gooSpec) {
		this.gooSpec = gooSpec;
	}

	public List<Deliverdetail> getDeliverdetails() {
		return this.deliverdetails;
	}

	public void setDeliverdetails(List<Deliverdetail> deliverdetails) {
		this.deliverdetails = deliverdetails;
	}

	public Deliverdetail addDeliverdetail(Deliverdetail deliverdetail) {
		getDeliverdetails().add(deliverdetail);
		deliverdetail.setGood(this);

		return deliverdetail;
	}

	public Deliverdetail removeDeliverdetail(Deliverdetail deliverdetail) {
		getDeliverdetails().remove(deliverdetail);
		deliverdetail.setGood(null);

		return deliverdetail;
	}

	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public Dictionary getDictionary1() {
		return this.dictionary1;
	}

	public void setDictionary1(Dictionary dictionary1) {
		this.dictionary1 = dictionary1;
	}

	public Dictionary getDictionary2() {
		return this.dictionary2;
	}

	public void setDictionary2(Dictionary dictionary2) {
		this.dictionary2 = dictionary2;
	}

	public List<Offersdetail> getOffersdetails() {
		return this.offersdetails;
	}

	public void setOffersdetails(List<Offersdetail> offersdetails) {
		this.offersdetails = offersdetails;
	}

	public Offersdetail addOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().add(offersdetail);
		offersdetail.setGood(this);

		return offersdetail;
	}

	public Offersdetail removeOffersdetail(Offersdetail offersdetail) {
		getOffersdetails().remove(offersdetail);
		offersdetail.setGood(null);

		return offersdetail;
	}

	public List<Orderdetail> getOrderdetails() {
		return this.orderdetails;
	}

	public void setOrderdetails(List<Orderdetail> orderdetails) {
		this.orderdetails = orderdetails;
	}

	public Orderdetail addOrderdetail(Orderdetail orderdetail) {
		getOrderdetails().add(orderdetail);
		orderdetail.setGood(this);

		return orderdetail;
	}

	public Orderdetail removeOrderdetail(Orderdetail orderdetail) {
		getOrderdetails().remove(orderdetail);
		orderdetail.setGood(null);

		return orderdetail;
	}

	public List<Repairlist> getRepairlists() {
		return this.repairlists;
	}

	public void setRepairlists(List<Repairlist> repairlists) {
		this.repairlists = repairlists;
	}

	public Repairlist addRepairlist(Repairlist repairlist) {
		getRepairlists().add(repairlist);
		repairlist.setGood(this);

		return repairlist;
	}

	public Repairlist removeRepairlist(Repairlist repairlist) {
		getRepairlists().remove(repairlist);
		repairlist.setGood(null);

		return repairlist;
	}

	public List<Returnmore> getReturnmores() {
		return this.returnmores;
	}

	public void setReturnmores(List<Returnmore> returnmores) {
		this.returnmores = returnmores;
	}

	public Returnmore addReturnmore(Returnmore returnmore) {
		getReturnmores().add(returnmore);
		returnmore.setGood(this);

		return returnmore;
	}

	public Returnmore removeReturnmore(Returnmore returnmore) {
		getReturnmores().remove(returnmore);
		returnmore.setGood(null);

		return returnmore;
	}

}